
		
	<div class="layuimini-container">
		<div id="app-form" class="layui-form layuimini-form">
			<div class="layui-form-item">

				<div class="layui-input-block layuimini-upload" id="test1">
					<input name="excel" id="xls" class="layui-input layui-col-xs6" lay-verify="required" lay-reqtext="请上传文件" placeholder="请上传文件" value="">
                    <button type="button" class="layui-btn" >
                        <i class="layui-icon">&#xe67c;</i>上传Excel
                    </button>
				</div>
                
				<div class="layui-input-block">
					<br>
					*请按照模板填好批量上传 <a href="{:url('supply.quoted/create_xlsx')}" style="color:brown">点击下载模板</a>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="import">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</div>
	</div>
	
	<script>
        layui.use(['jquery', 'upload'], function () {
            var upload = layui.upload;
            var $ = layui.jquery;

            upload.render({
                elem: '#test1' //2. 绑定元素
                , accept: 'file' //3. 指定允许上传时校验的文件类型，可选值有：images（图片）、file（所有文件）、video（视频）、audio（音频）
                , exts: 'xlsx' //4. 允许上传的文件后缀。一般结合 accept 参数类设定。
                , url: '{:url("upload")}' //5. 上传接口
                , done: function (res) {
                    console.log(res);
                    if (res.code == 0) {
                        $('#xls').val(res.data.src);
                    }
                }
                , error: function (res) {
                    //请求异常回调
                    console.log(2);
                }
            });
        })
	</script>	
        

	</body>
	</html>
</body>
</html>